from django.urls import include, path
from django.conf.urls import url

from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework.routers import DefaultRouter

from rest_framework import viewsets
from api.views import *

router = DefaultRouter()
# account router setting
router.register(r'movies', moviesViewSet)
router.register(r'categorys', categorysViewSet)
router.register(r'uris', playUrlViewSet)
#router.register(r'apiMovies', moviesView.as_view())


# set customer url config define
urlpatterns = format_suffix_patterns([
    path(r'm3u8', m3u8.as_view()),
    path(r'apiMovies', moviesView.as_view()),
    path(r'proxy', proxy.as_view()),
    path(r'saveTopCategory', spiderSaveTopType.as_view()),
    path(r'saveChildCategory', spiderSaveChildType.as_view()),
    path(r'saveMsg', spiderSaveMsg.as_view()),
    path(r'spiderByName', spiderByName.as_view())
])

urlpatterns += router.urls